// SpinButton.h: interface for the SpinButton class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_SPINBUTTON_H__D93AF5B5_A6E0_11D2_A455_006097A44215__INCLUDED_)
#define AFX_SPINBUTTON_H__D93AF5B5_A6E0_11D2_A455_006097A44215__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

class CLASS_DECL_D SpinButton : public AWTComponent,
                                public AWTAdjustable
{
DECLARE_DYNAMIC(SpinButton)
public:
	SpinButton();
	SpinButton(int orientation);
	virtual ~SpinButton();

	enum {
		HORIZONTAL = 0,
		VERTICAL
	};

  virtual int getOrientation()
		{return m_orientation;}
  virtual void setMinimum(int min){}
  virtual int getMinimum()
		{return 0;}
  virtual void setMaximum(int max){}
	virtual int getMaximum()
		{return 0;}
	virtual void setUnitIncrement(int u){}
	virtual int getUnitIncrement()
		{return 1;}
  virtual void setBlockIncrement(int b){}
  virtual int getBlockIncrement()
		{return 1;}
  virtual void setVisibleAmount(int v){}
  virtual int getVisibleAmount()
		{return 0;}
  virtual void setValue(int v){}
  virtual int getValue()
		{return 0;}
	virtual void addAdjustmentListener(AWTAdjustmentListener* l) 
		{m_adjustmentListener = AWTEventMulticaster::add(m_adjustmentListener, l);}
	virtual void removeAdjustmentListener(AWTAdjustmentListener* l) 
		{m_adjustmentListener = AWTEventMulticaster::remove(m_adjustmentListener, l);}

	void processAdjustmentEvent(AWTAdjustmentEvent* e);

	virtual CWnd* createComponent();
	virtual CSize getMinimumSize();
	virtual CSize getPreferredSize();
	virtual AWTAdjustable* getAdjustable()
		{return dynamic_cast<AWTAdjustable*>(this);}

private:
	void construct(int orientation)
	{
		m_orientation = orientation;
		m_adjustmentListener = NULL;
	}

protected:
	int m_orientation;
  AWTAdjustmentListener* m_adjustmentListener;
};

#endif // !defined(AFX_SPINBUTTON_H__D93AF5B5_A6E0_11D2_A455_006097A44215__INCLUDED_)
